// package com.liangtian.mdm.material.controller;
//
// import com.alibaba.fastjson.JSON;
// import com.alibaba.fastjson.JSONObject;
// import com.github.pagehelper.PageInfo;
// import com.liangtian.mdm.base.controller.BaseController;
// import com.liangtian.mdm.base.dao.JdbcDao;
// import com.liangtian.mdm.base.utils.ResultObject;
// import com.liangtian.mdm.base.utils.ShiroSessionUtils;
// import com.liangtian.mdm.dm.common.pojo.ResponseMsg;
// import com.liangtian.mdm.dm.common.util.RequestUtils;
// import com.liangtian.mdm.material.model.WlLbmbtzlqz;
// import com.liangtian.mdm.material.model.WlLbmbtzlqzBm;
// import com.liangtian.mdm.material.service.WlLbmbtzlqzBmService;
// import com.liangtian.mdm.material.service.WlLbmbtzlqzService;
// import com.liangtian.mdm.system.log.SysLogUtil;
// import com.liangtian.mdm.system.log.model.SysLogEnum;
// import com.liangtian.mdm.system.log.service.SysLogService;
// import com.liangtian.mdm.system.parameter.service.SysParameterService;
// import com.liangtian.mdm.system.user.model.SysUser;
// import com.liangtian.mdm.system.user.util.ExcelImport;
// import com.liangtian.mdm.util.ConstantBean;
// import com.liangtian.mdm.util.ExportUtil;
// import com.liangtian.mdm.util.IoUtil;
// import com.liangtian.mdm.util.TemplateName;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.stereotype.Controller;
// import org.springframework.web.bind.annotation.RequestMapping;
// import org.springframework.web.bind.annotation.RequestMethod;
// import org.springframework.web.bind.annotation.RequestParam;
// import org.springframework.web.bind.annotation.ResponseBody;
// import org.springframework.web.multipart.MultipartFile;
// import org.springframework.web.multipart.commons.CommonsMultipartFile;
//
// import javax.servlet.http.HttpServletRequest;
// import javax.servlet.http.HttpServletResponse;
// import java.io.IOException;
// import java.io.InputStream;
// import java.text.SimpleDateFormat;
// import java.util.*;
//
// @Controller
// @RequestMapping("/wlLbmbtzlqzController")
// public class WlLbmbtzlqzController extends BaseController {
//
//     @Autowired
//     private WlLbmbtzlqzService wlLbmbtzlqzService;
//
//     @Autowired
//     private SysParameterService sysParameterService;
//
//     @Autowired
//     private WlLbmbtzlqzBmService WlLbmbtzlqzBmService;
//
//     // 日志服务接口对象
//     @Autowired
//     SysLogService sysLogServiceImpl;
//
//     // Session中保存的当前登录用户的信息
//     //@Value("${ConstantBean.CURRENT_SESSION_USER}")
//     //private String ConstantBean.CURRENT_SESSION_USER;
//
//     @Autowired
//     JdbcDao jdbcDao;
//
//     private ExcelImport excelImport = new ExcelImport();
//
//     @ResponseBody
//     @RequestMapping(value = "/getWlLbmbtzlqzListByCond", method = RequestMethod.POST)
//     @SuppressWarnings({"rawtypes", "unchecked"})
//     public JSONObject getWlLbmbtzlqzListByCond(HttpServletRequest request, WlLbmbtzlqz tzlqz) {
//         Map paramMap = RequestUtils.paramToMap(request, WlLbmbtzlqz.class, false);
//         PageInfo pageInfo = wlLbmbtzlqzService.getWlLbmbtzlqzListByCond(paramMap);
//         List l = pageInfo.getList();
//         JSONObject jsonObject = new JSONObject();
//         jsonObject.put("rows", l);
//         jsonObject.put("total", pageInfo.getTotal());
//         return jsonObject;
//     }
//
//     @RequestMapping(value = "/insertWlLbmbtzlqz", method = RequestMethod.POST)
//     @ResponseBody
//     public ResultObject insertWlLbmbtzlqz(WlLbmbtzlqz tzlqz, HttpServletRequest request) {
//
//         // 获取当前日期
//         Date date = new Date();
//         // 获取session中用户
//         SysUser user = ShiroSessionUtils.getSessionSysUser(ConstantBean.CURRENT_SESSION_USER);
//
//         //添加之前查看下有没有已经删除的相同记录
//         WlLbmbtzlqz chk = new WlLbmbtzlqz();
//         chk.setWl_lbmbtzl_id(tzlqz.getWl_lbmbtzl_id());
//         chk.setQz(tzlqz.getQz());
//         chk.setStatus("2");
//         chk.setPageNum(1);
//         chk.setLength(1000000);
//         int result = wlLbmbtzlqzService.getWlLbmbtzlqzListCountByCond(chk);
//
//         int wlLbmbtzlqzid = 0;
//         if (result > 0) {
//             WlLbmbtzlqz getWlLbmbtzlqz = wlLbmbtzlqzService.getWlLbmbtzlqzListByCond(chk).get(0);
//             getWlLbmbtzlqz.setStatus("1");
//             getWlLbmbtzlqz.setSm(tzlqz.getSm());
//             getWlLbmbtzlqz.setUpdate_uid(String.valueOf(user.getUserId()));
//             getWlLbmbtzlqz.setUpdate_name(user.getUserName());
//             wlLbmbtzlqzService.updateWlLbmbtzlqz(getWlLbmbtzlqz);
//         } else {
//             tzlqz.setCreator_id(String.valueOf(user.getUserId()));
//             tzlqz.setCreator_name(user.getUserName());
//             wlLbmbtzlqzid = wlLbmbtzlqzService.insertWlLbmbtzlqz(tzlqz);
//         }
//
// 		/*// ==============================记录操作日志start===============================================
// 		SysLog sysLog = new SysLog();
// 		sysLog.setUserName(user.getUserName());
// 		sysLog.setBrowserType(BrowserUtils.getBrowserName(request));
// 		sysLog.setOperationDate(date);
// 		if (wlLbmbtzlqzid > 0) {
// 			sysLog.setOperationContent("用户【" + ShiroSessionUtils.getSessionSysUser(ConstantBean.CURRENT_SESSION_USER).getUserName()
// 					+ "】于" + DateUtils.dateToString(date, "yyyy-MM-dd HH:mm:ss") + ",添加模板特征量取值成功");
// 		} else {
// 			sysLog.setOperationContent("用户【" + ShiroSessionUtils.getSessionSysUser(ConstantBean.CURRENT_SESSION_USER).getUserName()
// 					+ "】于" + DateUtils.dateToString(date, "yyyy-MM-dd HH:mm:ss") + ",添加模板特征量取值失败");
// 		}
// 		sysLogServiceImpl.insertLog(sysLog);
// 		// ==============================记录操作日志end==================================================
// */
//         SysLogUtil.insertLog("新增物料类别模板特征量取值[" + tzlqz.getQz() + "]",
//                 SysLogEnum.WL_LBMB_TZLQZ.getCode(), SysLogEnum.XZ.getCode(), request);
//         ResultObject resultObject = new ResultObject(wlLbmbtzlqzid, "新增成功", "新增失败");
//         return resultObject;
//     }
//
//     @ResponseBody
//     @RequestMapping(value = "/getWlLbmbtzlqzListCountByCond", method = RequestMethod.POST)
//     public JSONObject getWlLbmbtzlqzListCountByCond(HttpServletRequest request, WlLbmbtzlqz tzlqz) {
//         JSONObject jsonObject = new JSONObject();
//         //ResponseMsg<String> rMsg = new ResponseMsg<String>();
//         int count = 0;
//         String msg = "";
//         try {
//             count = wlLbmbtzlqzService.getWlLbmbtzlqzListCountByCond(tzlqz);
//             //新增 如果特征量取值表不存在，再去取值别名表中校验
//             if (count == 0) {
//                 Map<String, Object> cond = new HashMap<>();
//                 cond.put("tzlqz_id", tzlqz.getId());
//                 cond.put("qzbm", tzlqz.getQz());
//                 List<WlLbmbtzlqzBm> list = WlLbmbtzlqzBmService.queryWlLbmbtzlqzBmByCond(cond);
//                 if (!StringUtils.isEmpty(list)) {
//                     count = list.size();
//                     msg = "添加的特征量取值已维护在【" + list.get(0).getQz() + "】的别名中";
//                 }
//
//             } else
//                 msg = "添加的特征量取值已经存在";
//             //rMsg.setRspCode(count);
//         } catch (Exception e) {
//             e.printStackTrace();
//         }
//         jsonObject.put("count", count);
//         jsonObject.put("msg", msg);
//         return jsonObject;
//     }
//
//     @ResponseBody
//     @RequestMapping(value = "/getWlLbmbtzlqzById", method = RequestMethod.POST)
//     public String getWlLbmbtzlqzById(WlLbmbtzlqz tzlqz) {
//         WlLbmbtzlqz wlbmjldw = null;
//         try {
//             wlbmjldw = wlLbmbtzlqzService.getWlLbmbtzlqzById(tzlqz);
//         } catch (Exception e) {
//             e.printStackTrace();
//         }
//         return JSON.toJSONString(wlbmjldw);
//     }
//
//     @RequestMapping(value = "getTzlSmByQz", method = RequestMethod.POST)
//     @ResponseBody
//     public JSONObject getTzlSmByQz(WlLbmbtzlqz tzlqz) {
//         JSONObject jsonObject = new JSONObject();
//         WlLbmbtzlqz wlbmjldw = null;
//         try {
//             wlbmjldw = wlLbmbtzlqzService.getWlLbmbtzlqzById(tzlqz);
//         } catch (Exception e) {
//             e.printStackTrace();
//         }
//         if (!StringUtils.isEmpty(wlbmjldw)) {
//             jsonObject.put("tzlqz", wlbmjldw);
//             jsonObject.put("success", true);
//         } else
//             jsonObject.put("success", false);
//         return jsonObject;
//     }
//
//     @ResponseBody
//     @RequestMapping(value = "/getCountWlLbmbTzlQzByCond", method = RequestMethod.POST)
//     public JSONObject getCountWlLbmbTzlQzByCond(HttpServletRequest request, WlLbmbtzlqz tzlqz) {
//         JSONObject jsonObject = new JSONObject();
//         ResponseMsg<String> rMsg = new ResponseMsg<String>();
//         try {
//             int count = wlLbmbtzlqzService.getCountWlLbmbTzlQzByCond(tzlqz);
//             rMsg.setRspCode(count);
//         } catch (Exception e) {
//             e.printStackTrace();
//         }
//         jsonObject.put("rmsg", rMsg);
//         return jsonObject;
//     }
//
//     @ResponseBody
//     @RequestMapping(value = "/updateWlLbmbtzlqz", method = RequestMethod.POST)
//     public JSONObject updateWlLbmbtzlqz(WlLbmbtzlqz tzlqz, HttpServletRequest request) {
//         JSONObject jsonObject = new JSONObject();
//         ResponseMsg<String> rMsg = new ResponseMsg<String>();
//         try {
//             // 获取session中用户
//             SysUser user = ShiroSessionUtils.getSessionSysUser(ConstantBean.CURRENT_SESSION_USER);
//             tzlqz.setUpdate_uid(String.valueOf(user.getUserId()));
//             tzlqz.setUpdate_name(user.getUserName());
//             wlLbmbtzlqzService.updateWlLbmbtzlqz(tzlqz);
//             rMsg.setRspCode(0);
//             //记录日志
//             SysLogUtil.insertLog("编辑物料类别模板特征量取值[" + tzlqz.getQz() + "]",
//                     SysLogEnum.WL_LBMB_TZLQZ.getCode(), SysLogEnum.BJ.getCode(), request);
//         } catch (Exception e) {
//             e.printStackTrace();
//             rMsg.setRspCode(-1);
//         }
//         jsonObject.put("rmsg", rMsg);
//         return jsonObject;
//     }
//
//     @ResponseBody
//     @RequestMapping(value = "/updateWlLbmbtzlqzByMap", method = RequestMethod.POST)
//     public ResultObject updateWlLbmbtzlqzByMap(HttpServletRequest request) {
//         String ids = request.getParameter("ids");
//         if (ids == null || "".equals(ids))
//             return null;
//         Map<String, Object> map = new HashMap<>();
//         map.put("idList", ids.split(","));
//         int ret = wlLbmbtzlqzService.updateWlLbmbtzlqzByMap(map);
//         int f = ret > 0 ? 1 : 0;
//         //记录日志
//         SysLogUtil.insertLog("删除物料类别模板特征量取值[" + ids + "]",
//                 SysLogEnum.WL_LBMB_TZLQZ.getCode(), SysLogEnum.SC.getCode(), request);
//         ResultObject result = new ResultObject(f, "删除成功", "删除失败");
//         return result;
//     }
//
//     /**
//      * 导出特征量取值模板
//      *
//      * @param modelId
//      * @param tableName
//      * @return
//      */
//     @RequestMapping(value = "wlLbmbTzlQzExport", method = RequestMethod.GET)
//     @ResponseBody
//     public String wlLbmbTzlQzExport(HttpServletResponse response, HttpServletRequest request) {
//
//         String path = IoUtil.getTemplatePath();
//         String fileName = TemplateName.TZLQZ_TEMPLATE;//服务器上存的文件名
//         String uploadFileName = "特征量取值导入模板";//给用户下载看到的文件名
//         ExportUtil.exportTemplate(path, fileName, uploadFileName, response);
//     	/*InputStream inStream = null;
// 		String fileName = null;
// 		OutputStream outStream = null;
// 		try {
// 			String path = Thread.currentThread().getContextClassLoader().getResource("").toString();
// 			path=path.replace('/', '\\'); // 将/换成\
// 			path=path.replace("classes\\", ""); //去掉class\
// 			path=path.replace("file:\\", ""); //file:\
// 			path += "doc\\dataTemplate";
// 			response.setCharacterEncoding("UTF-8");
// 			response.setContentType("application/vnd.ms-excel");
// 			fileName = "特征量取值导入模板.xlsx";
// 			response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName,"UTF-8"));
// 			File file = new File(path,fileName);
// 			inStream = new FileInputStream(file);
// 			byte[] bytes = new byte[1024];
// 			int len;
// 			outStream = response.getOutputStream();
// 			while((len = inStream.read(bytes)) != -1 ) {
// 				outStream.write(bytes, 0, len);
// 	        }
// 			outStream.flush();
// 			outStream.close();
// 			outStream = null;
// 			response.flushBuffer();
// 		} catch (IOException e) {
// 			e.printStackTrace();
// 		} finally {
// 			if(inStream != null){
// 				try{inStream.close();}
// 				catch(Exception e){}
// 			}
// 		}*/
//         return null;
//     }
//
//     /**
//      * 导入物料模板特征量取值
//      *
//      * @param modelId
//      * @param tableName
//      * @return
//      */
//     @RequestMapping(value = "excelImport", method = RequestMethod.POST)
//     @ResponseBody
//     public ResultObject excelImport(@RequestParam("excel") CommonsMultipartFile[] files,
//                                     HttpServletResponse response, HttpServletRequest request) {
//         String tzlid = request.getParameter("wl_lbmbtzl_id");
//         ResultObject resuObj = null;
//         String bool = "true";
//         String info = null;
//         try {
//             MultipartFile file = files[0];
//             if (null == file) {
//                 bool = "false";
//                 info = "\n文件上传异常！";
//             } else {
//                 InputStream input = file.getInputStream();
//                 Map<String, Object> map = wlLbmbtzlqzService.tzlqzImport(input, tzlid);
//                 if (!(Boolean) map.get("success"))
//                     bool = "false";
//                 info = (String) map.get("info");
//
//             }
//
//         } catch (IOException e) {
//             bool = "false";
//             info = e.getMessage();
//         }
//         //错误文档
//         if ("false".equals(bool)) {
//             String fileName = "wlmbtzlqzImportError" + new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + ".txt";
//             try {
//                 ExportUtil.errTxt(info, fileName);
//                 info = fileName;//返回给前台的文件名
//             } catch (IOException e) {
//                 // TODO Auto-generated catch block
//                 e.printStackTrace();
//             }
//         }
//         resuObj = new ResultObject(bool, info);
//         return resuObj;
// 		/*ResultObject result=null;
// 		try {
// 			String tableName=request.getParameter("tableName");
// 			String tzlid = request.getParameter("wl_lbmbtzl_id");
//         	MultipartHttpServletRequest mulRequest = (MultipartHttpServletRequest) request;
//             MultipartFile file = mulRequest.getFile("excel");
//          // 获取路径
// 			String ctxPath = request.getSession().getServletContext().getRealPath("/") + "upload" + File.separator;
// 			// 创建文件
// 			File dirPath = new File(ctxPath);
// 			if (!dirPath.exists()) {
// 				dirPath.mkdir();
// 			}
// 			File uploadFile = new File(ctxPath + file.getOriginalFilename());
//
//     		// 保存上传的文件到服务器发布项目中的upload文件夹下
// 			FileCopyUtils.copy(file.getBytes(), uploadFile);
//
// 			Workbook book = excelImport.getWorkbook(uploadFile);
// 			int sheetNum = 0;
// 			// 得到sheet总数
// 			sheetNum = book.getNumberOfSheets();
// 			for (int i = 0; i < sheetNum; i++) {
// 				Sheet sheet = book.getSheetAt(i);
// 				List<Object[]> valueList = excelImport.read(sheet);
// 				// 插入数据
// 				if(valueList != null && valueList.size() > 0) {
// 					result = checkImportList(valueList,tableName,tzlid);
// 				}
// 			}
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 		}
// 		return result;*/
//     }
//
//     /*
//      * 2017-06-29
//      * jyh
//      * 错误日志下载抽取至LogErrorsController中
//      */
//     /**
//      * * <p>Title: 导入数据，错误文档</p>
//      * <p>Company:@param response
//      * <p>Company:@param request </p>
//      */
//     /*@RequestMapping(value = "downLoadErr", method = RequestMethod.POST)
//     @ResponseBody
//     public void downLoadErr(HttpServletResponse response,HttpServletRequest request){
//     	String fileName = request.getParameter("err_fileName");
// 		String path = WlLbmbtzlqzController.class.getProtectionDomain().getCodeSource()
//                 .getLocation().getPath();
// 		String file=path.substring(1, path.indexOf("/WEB-INF/classes"))+"/error_text/"+fileName;
// 		System.out.println("file:"+file);
// 		try {
// 			InputStream inStream = new FileInputStream(file);
// 			if(request.getHeader("User-Agent").toUpperCase().indexOf("MSIE") > 0){
// 			     fileName = URLEncoder.encode(fileName, "UTF-8");//IE浏览器
// 			}else{
// 			     fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1");//firefox浏览器
// 			}
// 			response.reset();
// 			response.setCharacterEncoding("UTF-8");
// 			response.setContentType("application/octet-stream; charset=UTF-8");
// 			response.addHeader("Content-Disposition",  "attachment;filename=\"" + fileName + "\"");
// 			// 循环取出流中的数据
// 			byte[] b = new byte[100];
// 			int len;
// 			OutputStream output=response.getOutputStream();
// 			while ((len = inStream.read(b)) > 0)
// 				output.write(b, 0, len);
//
// 			output.flush();
// 			output.close();
// 			inStream.close();
// 		} catch (FileNotFoundException e) {
// 			e.printStackTrace();
// 		} catch (UnsupportedEncodingException e) {
// 		} catch (IOException e) {
// 			e.printStackTrace();
// 		}
// 	}*/
//
//     /**
//      * 取关联取值
//      *
//      * @return
//      * @author jiangyh
//      * @date 2016-12-26
//      */
//     @RequestMapping(value = "getGlQz", method = RequestMethod.POST)
//     @ResponseBody
//     public JSONObject getGlQz(HttpServletRequest request) {
//         JSONObject jsonObject = new JSONObject();
//         String currTzlId = StringUtils.trimToEmpty(request.getParameter("currTzlId"));
//         String loadAll = StringUtils.trimToEmpty(request.getParameter("loadAll"));
//         String glTzlInfo = StringUtils.trimToEmpty(request.getParameter("glTzlInfo"));
//         List<WlLbmbtzlqz> list = new ArrayList<WlLbmbtzlqz>();
//         int limit = Integer.parseInt(sysParameterService.getSysParamValue("tzlzComboboxLimit", "200"));
//         if (loadAll.equals("1")) {//如果是需要加载全部
//             WlLbmbtzlqz qzcond = new WlLbmbtzlqz();
//             qzcond.setWl_lbmbtzl_id(currTzlId);
//             qzcond.setStatus("1");
//             int qzcount = wlLbmbtzlqzService.getWlLbmbtzlqzListCountByCond(qzcond);
//             jsonObject.put("qzcount", qzcount);
//             //特征量取值控件加载取值个数限制
//             //int limit = Integer.parseInt(SysParametersUtil.getParameterValueForDefault("tzlzComboboxLimit","200"));
//             if (qzcount <= limit) {//如果取值个数超过限制就不取出，页面中另处理
//                 //qzcond.setPageNo(1);
//                 //qzcond.setPageSize(limit);
//                 list = wlLbmbtzlqzService.getWlLbmbtzlqzListByCond(qzcond);
//             }
//         } else {
//             Map<String, Object> cond = new HashMap<>();
//             cond.put("currTzlId", currTzlId);
//             cond.put("gl_std_tzl_id", glTzlInfo.split(",")[0].split(":")[0]);
//             cond.put("gl_std_tzlqz_id", glTzlInfo.split(",")[0].split(":")[1]);
//             list = wlLbmbtzlqzService.getGlQzListByCond(cond);
//             jsonObject.put("glcount", list.size());
//         }
//         for (WlLbmbtzlqz tzlqz : list) {
//             String qz = tzlqz.getQz();
//             tzlqz.setQz(StringUtil.encodeHtml(qz));
//         }
//         jsonObject.put("data", list);
//         jsonObject.put("tzlzLimit", limit);
//         jsonObject.put("success", true);
//         return jsonObject;
//     }
//
//     @SuppressWarnings("rawtypes")
//     @RequestMapping(value = "/queryWlLbmbtzlqz", method = RequestMethod.POST)
//     @ResponseBody
//     public JSONObject queryWlLbmbtzlqz(HttpServletRequest request) {
//         JSONObject jsonObject = new JSONObject();
//         Map<String, Object> paramMap = RequestUtils.paramToMap(request);
//         PageInfo pageInfo = wlLbmbtzlqzService.getWlLbmbtzlqzListByCond(paramMap);
//         jsonObject.put("rows", pageInfo.getList());
//         jsonObject.put("total", pageInfo.getTotal());
//         return jsonObject;
//     }
//
//     /**
//      * 查询类别下所有特征量取值别名
//      *
//      * @param request
//      * @return
//      * @author ly
//      */
//     @ResponseBody
//     @RequestMapping(value = "/getWlLbmbtzlqzBmByCond", method = RequestMethod.POST)
//     @SuppressWarnings({"rawtypes", "unchecked"})
//     public JSONObject getWlLbmbtzlqzBmByCond(HttpServletRequest request) {
//         Map<String, Object> paramMap = RequestUtils.paramToMap(request);
//         PageInfo pageInfo = WlLbmbtzlqzBmService.getWlLbmbtzlqzBmByCond(paramMap);
//         List l = pageInfo.getList();
//         JSONObject jsonObject = new JSONObject();
//         jsonObject.put("rows", l);
//         jsonObject.put("total", pageInfo.getTotal());
//         return jsonObject;
//     }
//
//     /**
//      * 查询特征量取值别名
//      *
//      * @param request
//      * @return
//      * @author ly
//      */
//     @ResponseBody
//     @RequestMapping(value = "/queryWlLbmbtzlqzBmByCond", method = RequestMethod.POST)
//     public JSONObject queryWlLbmbtzlqzBmByCond(HttpServletRequest request) {
//         Map<String, Object> paramMap = RequestUtils.paramToMap(request);
//         List<WlLbmbtzlqzBm> list = WlLbmbtzlqzBmService.queryWlLbmbtzlqzBmByCond(paramMap);
//         JSONObject jsonObject = new JSONObject();
//         jsonObject.put("list", list);
//         return jsonObject;
//     }
//
//     /**
//      * 添加特征量取值别名
//      *
//      * @param request
//      * @return
//      * @author ly
//      */
//     @ResponseBody
//     @RequestMapping(value = "/insertWlLbmbtzlqzBm", method = RequestMethod.POST)
//     public ResultObject insertWlLbmbtzlqzBm(HttpServletRequest request) {
//         String tzlqz_id = request.getParameter("tzlqz_id");
//         String qz = request.getParameter("qz");
//         String qzbm = request.getParameter("qzbm");
//         // 获取当前日期
//         Date date = new Date();
//         // 获取session中用户
//         SysUser user = ShiroSessionUtils.getSessionSysUser(ConstantBean.CURRENT_SESSION_USER);
//         //Map<String, Object> paramMap = RequestUtils.paramToMap(request);
//         //paramMap.put("createAccount", user.getUserAccount());
//         WlLbmbtzlqzBm wllbbm = new WlLbmbtzlqzBm();
//         wllbbm.setTzlqz_id(tzlqz_id);
//         wllbbm.setQz(qz);
//         wllbbm.setQzbm(qzbm);
//         wllbbm.setCreator_name(user.getUserName());
//         wllbbm.setCreate_account(user.getUserAccount());
//         int count = WlLbmbtzlqzBmService.insertWlLbmbtzlqzBm(wllbbm);
//
// 		/*// ==============================记录操作日志start===============================================
// 		SysLog sysLog = new SysLog();
// 		sysLog.setUserName(user.getUserName());
// 		sysLog.setBrowserType(BrowserUtils.getBrowserName(request));
// 		sysLog.setOperationDate(date);
// 		if (count > 0) {
// 			sysLog.setOperationContent("用户【" + ShiroSessionUtils.getSessionSysUser(ConstantBean.CURRENT_SESSION_USER).getUserName()
// 					+ "】于" + DateUtils.dateToString(date, "yyyy-MM-dd HH:mm:ss") + ",添加【"+qz+"】别名【"+qzbm+"】成功");
// 		} else {
// 			sysLog.setOperationContent("用户【" + ShiroSessionUtils.getSessionSysUser(ConstantBean.CURRENT_SESSION_USER).getUserName()
// 					+ "】于" + DateUtils.dateToString(date, "yyyy-MM-dd HH:mm:ss") + ",添加【"+qz+"】别名【"+qzbm+"】失败");
// 		}
// 		sysLogServiceImpl.insertLog(sysLog);
// 		// ==============================记录操作日志end==================================================
// */
//         SysLogUtil.insertLog("新增物料类别模板特征量取值别名[" + qzbm + "]",
//                 SysLogEnum.WL_LBMB_TZLQZ_BM.getCode(), SysLogEnum.XZ.getCode(), request);
//         ResultObject resultObject = new ResultObject(count, "新增成功", "新增失败");
//         return resultObject;
//     }
//
//     @ResponseBody
//     @RequestMapping(value = "/deleteWlLbmbtzlqzBmByIds", method = RequestMethod.POST)
//     public ResultObject deleteWlLbmbtzlqzBmByIds(HttpServletRequest request) {
//         String ids = request.getParameter("ids");
//         if (ids == null || "".equals(ids))
//             return null;
//         int ret = WlLbmbtzlqzBmService.deleteWlLbmbtzlqzBmByIds(toList(ids));
//         int f = ret > 0 ? 1 : 0;
//         ResultObject result = new ResultObject(f, "删除成功", "删除失败");
//         return result;
//     }
//
//     /**
//      * 传入一个ID字符串(以,号连接的),解析后,返回ID集合
//      *
//      * @param array
//      * @return List<String>
//      * @author jyh
//      */
//     public List<String> toList(String array) {
//         ArrayList<String> list = new ArrayList<String>();
//         if (array != null) {
//             for (String string : array.split(",")) {
//                 list.add(string);
//             }
//         }
//         return list;
//     }
//
// }
